#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QIcon>
#include "udp.h"
#include "tcp.h"

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    qmlRegisterType<Udp>("com.mycompany.udp",1,0,"Udp");
    qmlRegisterType<Tcp>("com.mycompany.tcp",1,0,"Tcp");
    QQmlApplicationEngine engine;
    //const QUrl url(QStringLiteral("qrc:/DDConnect/Main.qml"));z这是没有归纳到qml文件夹前的引用方式
    const QUrl url(QStringLiteral("qrc:/DDConnect/qml/Main.qml"));
    QObject::connect(
        &engine,
        &QQmlApplicationEngine::objectCreationFailed,
        &app,
        []() { QCoreApplication::exit(-1); },
        Qt::QueuedConnection);
    engine.load(url);

    return app.exec();
}
